/**
 * Created by loso on 2017/3/15.
 */
public class _342_PowerOfFour {
    public static void main(String[] args) {
        System.out.println(isPowerOfFour(64));
    }

    public static boolean isPowerOfFour(int num) {
        if (num == 0){
            return false;
        }
        boolean flag = false;
        for (int i = 0; i < 32; i++) {
            int i1 = num & 1;
            int i2 = i & 1;
            if (i1 == 1) {
                if (i == 1 || i2 != 0 || flag) {
                    return false;
                } else {
                    flag = true;
                }
            }
            num = num >> 1;
        }
        return true;
}
}
